<?php

define('FPDF_FONTPATH','font/');



require('Paperpdf.class.php' );
$init=array(215.9,93.1);


$paperpdf = new paperpdf('L','mm',$init); 
$paperpdf->AddGBhwFont('simhei','黑体'); 
$paperpdf->AddGBhwFont('simsun','宋体'); 
$paperpdf->AddPage(); 
$paperpdf->SetMargins(5,8,5); 
$paperpdf->SetFont('simhei','','12'); 
$paperpdf->SetXY(7,5); 
$paperpdf->Text(7,8,'振兴市政水电费通知单');
$paperpdf->Text(180,8,'2011年7月');
$paperpdf->Line(7,9,210,9);
$paperpdf->SetXY(7,10);
$header=array('Name','Age','Sex','Salary'); //���ñ�ͷ
$data=array(); //���ñ���
$data[0] = array('Simon','24','Male','5,000.00');
$data[1] = array('Elaine','25','Female','6,000.00');
$data[2] = array('Susan','25','Female','7,000.00');
$data[3] = array('David','26','Male','8,000.00');
$width=array(45,45,45,45); //����ÿ�п��
$paperpdf->SetFont('simsun','','12'); 
for($i=0;$i<count($header);$i++) //ѭ�������ͷ
$paperpdf->Cell($width[$i],6,$header[$i],1);
$paperpdf->Ln();

foreach($data as $row) //ѭ���������
{
	$paperpdf->SetX(7);
$paperpdf->Cell($width[0],6,$row[0],1);
$paperpdf->Cell($width[1],6,$row[1],1);
$paperpdf->Cell($width[2],6,$row[2],1);
$paperpdf->Cell($width[3],6,$row[3],1);
$paperpdf->Ln();
}


//$paperpdf->IncludeJS("print({bUI: false,bSilent: true,bShrinkToFit: false});closeDoc();"); 
//$paperpdf->Output(); //���PDF �������

$paperpdf->Output('foobar.pdf','I'); 
?>